package lexer

// Token 词法单元
type Token struct {
	Type    TokenType
	Literal string
}

// 定义一些经常用到的词法单元单例
var (
	TOKEN_EOF = &Token{Type: EOF, Literal: ""}

	TOKEN_SELECT    = &Token{Type: SELECT, Literal: "SELECT"}
	TOKEN_FROM      = &Token{Type: FROM, Literal: "FROM"}
	TOKEN_WHERE     = &Token{Type: WHERE, Literal: "WHERE"}
	TOKEN_CREATE    = &Token{Type: CREATE, Literal: "CREATE"}
	TOKEN_TABLE     = &Token{Type: TABLE, Literal: "TABLE"}
	TOKEN_INSERT    = &Token{Type: INSERT, Literal: "INSERT"}
	TOKEN_INTO      = &Token{Type: INTO, Literal: "INTO"}
	TOKEN_VALUES    = &Token{Type: VALUES, Literal: "VALUES"}
	TOKEN_UPDATE    = &Token{Type: UPDATE, Literal: "UPDATE"}
	TOKEN_SET       = &Token{Type: SET, Literal: "SET"}
	TOKEN_DELETE    = &Token{Type: DELETE, Literal: "DELETE"}
	TOKEN_DROP      = &Token{Type: DROP, Literal: "DROP"}
	TOKEN_PRIMARY   = &Token{Type: PRIMARY, Literal: "PRIMARY"}
	TOKEN_KEY       = &Token{Type: KEY, Literal: "KEY"}
	TOKEN_LIKE      = &Token{Type: LIKE, Literal: "LIKE"}
	TOKEN_BETWEEN   = &Token{Type: BETWEEN, Literal: "BETWEEN"}
	TOKEN_AND       = &Token{Type: AND, Literal: "AND"}
	TOKEN_DEFAULT   = &Token{Type: DEFAULT, Literal: "DEFAULT"}
	TOKEN_GROUP     = &Token{Type: GROUP, Literal: "GROUP"}
	TOKEN_BY        = &Token{Type: BY, Literal: "BY"}
	TOKEN_ORDER     = &Token{Type: ORDER, Literal: "ORDER"}
	TOKEN_ASC       = &Token{Type: ASC, Literal: "ASC"}
	TOKEN_DESC      = &Token{Type: DESC, Literal: "DESC"}
	TOKEN_DATABASE  = &Token{Type: DATABASE, Literal: "DATABASE"}
	TOKEN_DATABASES = &Token{Type: DATABASES, Literal: "DATABASES"}
	TOKEN_SHOW      = &Token{Type: SHOW, Literal: "SHOW"}
	TOKEN_USE       = &Token{Type: USE, Literal: "USE"}
	TOKEN_TABLES    = &Token{Type: TABLES, Literal: "TABLES"}
	TOKEN_INNER     = &Token{Type: INNER, Literal: "INNER"}
	TOKEN_LEFT      = &Token{Type: LEFT, Literal: "LEFT"}
	TOKEN_RIGHT     = &Token{Type: RIGHT, Literal: "RIGHT"}
	TOKEN_JOIN      = &Token{Type: JOIN, Literal: "JOIN"}
	TOKEN_ON        = &Token{Type: ON, Literal: "ON"}

	TOKEN_EQ  = &Token{Type: EQ, Literal: "="}
	TOKEN_GT  = &Token{Type: GT, Literal: ">"}
	TOKEN_LT  = &Token{Type: LT, Literal: "<"}
	TOKEN_GTE = &Token{Type: GTE, Literal: ">="}
	TOKEN_LTE = &Token{Type: LTE, Literal: "<="}
	TOKEN_NEQ = &Token{Type: NEQ, Literal: "!="}

	TOKEN_COMMA    = &Token{Type: COMMA, Literal: ","}
	TOKEN_SEMI     = &Token{Type: SEMI, Literal: ";"}
	TOKEN_LPAREN   = &Token{Type: LPAREN, Literal: "("}
	TOKEN_RPAREN   = &Token{Type: RPAREN, Literal: ")"}
	TOKEN_ASTERISK = &Token{Type: ASTERISK, Literal: "*"}
	TOKEN_DOT      = &Token{Type: DOT, Literal: "."}
)
